package edu.zut.bailan.timecard.domain;

import edu.zut.bailan.base.domain.BaseTreeEntity;

import javax.persistence.*;
import java.util.List;
@Entity
@Table(name = "T_PRODUCT_CATEGORY")
@NamedQueries({ @NamedQuery(name = "ProductCategory.getRoot", query = "select m from TimeCardCategory m where m.parent is null") })
public class TimeCardCategory extends BaseTreeEntity<TimeCardCategory, Long> {


    private static final long serialVersionUID = 4373909818672794337L;


    String code;


    String name;

    @OneToMany(mappedBy = "timeCardCategory", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
    List<TimeCard> products;
    public void setId(Long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setName(String name) {
        this.name = name;
    }

}
